package git.soulbgm.listener;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * 消息侦听器
 *
 * @author SoulBGM
 * @date 2021/07/12
 */
@Component
public class RedisMessageListener implements MessageListener {

    @Override
    public void onMessage(Message message, byte[] pattern) {
        System.out.println(new String(pattern));
        System.out.println(new String(message.getChannel()));
        System.out.println(new String(message.getBody()));
    }

}
